{% block field_errorsx %}
{% spaceless %}
    {% if errors|length > 0 %}
    <span style="color:red">
        {% for error in errors %}
            {{ error.messageTemplate|trans(error.messageParameters, 'validators') }}<br />
        {% endfor %}
    {% endif %}
{% endspaceless %}
{% endblock field_errorsx %}

{# Can I isolate label attributes #}
{% block label_attributesx %}
{% spaceless %}
    {% for attrname,attrvalue in attr %}{% if attrname == 'for' %} {{attrname}}="{{attrvalue}}"{% endif %}{% if attrname == 'class' %} {{attrname}}="{{attrvalue}}"{% endif %}{% endfor %}>        
{% endspaceless %}
{% endblock %}
    
{# Can I isolate label attributes #}
{% block label_attributes %}
{% spaceless %}
    {% for attrname,attrvalue in attr %}{% if (attrname == 'for' or attrname == 'class') %} {{attrname}}="{{attrvalue}}"{% endif %}{% endfor %}
{% endspaceless %}
{% endblock %}
            
{# Try to limit the label attributes #}
{% block generic_label %}
{% spaceless %}
    {% if required %}
        {% set attr = attr|merge({'class': attr.class|default('') ~ ' required'}) %}
    {% endif %}
    <label {{ block('label_attributes') }}>{{ label|trans }}</label>
{% endspaceless %}
{% endblock %}
    
{# Ends up processing a form_row #}
{% block field_row %}
{% spaceless %}
    <div>
        {{ form_label(form, label|default(null)) }}
        {{ form_errors(form) }}
        {{ form_widget(form) }}
    </div>
{% endspaceless %}
{% endblock field_row %}

